<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            box-sizing: border-box;
            -webkit-appearance: none;
        }
        .container {
            display: flex;flex-wrap: wrap;
        }
        .box {
            border: 2px solid red;
            width: 50%;
            flex: 1 0 50%;
        }
    </style>
</head>

<body>

    <h1>自动适应盒子高度 (不折叠): </h1>
    <xpm>
        <pre style="font-size: 22px;">
            .container {
                display: flex;flex-wrap: wrap;
            }
            .box {
                border: 2px solid red;
                width: 50%;
                flex: 1 0 50%;
            }
        </pre>
    </xpm>

    <div class="container">
        <div class="box a">
            <h1>Lorem ipsum dolor sit amet.</h1>
        </div>
        <div class="box b">
            <h1>Lorem ipsum dolor sit ametipsum dolor sit amet.</h1>
        </div>
        <div class="box c">
            <h1>Lorem ipsum dolor sit amet.</h1>
        </div>
        <div class="box d">
            <h1>Lorem ipsum dolor sit ametipsum dolor sit ametametipsum dolor sit ametametipsum dolor sit ametametipsum dolor sit amet.</h1>
        </div>
        <div class="box c">
            <h1>Lorem ipsum dolor sit amet.</h1>
        </div>
        <div class="box d">
            <h1>Lorem ipsum dolor sit ametipsum dolor sit amet.</h1>
        </div>
        <div class="box c">
            <h1>Lorem ipsum dolor sit amet.</h1>
        </div>
        <div class="box d">
            <h1>Lorem ipsum dolor sit ametipsum dolor sit amet.</h1>
        </div>
        <div class="box d">
            <h1>Lorem ipsum dolor sit ametipsum dolor sit amet.</h1>
        </div>
        <div class="box c">
            <h1>Lorem ipsum dolor sit amet.</h1>
        </div>
    </div>
</body>

</html>
